home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / NeoIntroTCL3.0 folder / TCL / NeoDemo / Includes / CNDImage.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-16  |  2.8 KB  |  105 lines  |  [TEXT/KAHL]

  1. /****
  2.  * CNDImage.h
  3.  *
  4.  *  Copyright © 1992 NeoLogic Systems.  All rights reserved.
  5.  *
  6.  ****/
  7.  
  8. #pragma once            /* Include this file only once */
  9.  
  10. #include CNeoBlobH
  11. #include CNeoSelectH
  12.  
  13. class CNDImage;
  14. class CNDCamera;
  15.  
  16. enum {
  17.     typeNeoImage         = 'Nimg'
  18. };
  19.  
  20. #define cImage            'imag'
  21. #define kNDImageID        21
  22. #define kKeywords          10                /* max number of comma delimited keys in 'keywords' box */
  23.  
  24. typedef enum filmT {
  25.     eTriX,
  26.     ePanX,
  27.     eUnknown
  28. } filmT;
  29.  
  30. class CNeoKeywordSelect;
  31.  
  32. typedef char            keyArray[kKeywords][33];
  33. typedef keyArray *        keyArrayPtr;
  34.  
  35. class CNDImage : public CNeoBlob {
  36. public:
  37.                         /** Instance Methods **/
  38.                         CNDImage(void);
  39.     virtual long        getLength(void) const;
  40.     virtual long        getFileLength(void) const;
  41.     virtual OSErr        getValue(const NeoTag aName, const NeoTag aType, void *aValue);
  42.  
  43.                         /** I/O Methods **/
  44.     virtual void        readObject(CNeoStream *aStream, const NeoTag aTag);
  45.     virtual void        writeObject(CNeoStream *aStream, const NeoTag aTag);
  46.  
  47.                         /** Rendering Methods **/
  48.     virtual void        draw(Rect *aRect);
  49.  
  50.                         /** Search Methods **/
  51.     static CNDImage *    FindByName(CNeoDatabase *aFile, const NeoID aClassID, const CNeoString &aName, const Boolean aDeeply, NeoTestFunc1 aFunc = nil, void *aParam = nil, const NeoLockType aLock = kNeoDefaultLock);
  52.     CNDCamera *            getCamera(void);
  53.     static void *        GetImageID(CNeoNode *aNode, const short aIndex, const NeoLockType aLock, void *aParam);
  54.  
  55.                         /** Keyword Methods **/
  56.     static CNeoKeywordSelect *
  57.                         GetKeywordKey(char *aKey);
  58.     void                 buildKeyWordStr(char *str);                 /* construct single string from keywords array */
  59.     void                 parseKeywords(char *str);                 /* get comma delimited strings into array */
  60.  
  61.                         /** Instance Variables **/
  62.     short                fKeyCount;                    /* number of actual keys in fKeys */
  63.     short                  fExposure;
  64.     short                  fFilm;
  65.     short                  fFocal;
  66.     short                  fFStop;
  67.     NeoID                fCamera;
  68.     keyArray            fKeys;                        /* holds strings from comma delimited text in 'keywords' box */
  69.     CNeoString            fName;
  70.     CNeoString            fBy;
  71.     CNeoString            fDate;
  72.     CNeoString            fCatalog;
  73. };
  74.  
  75. const long kNDImageFileLength    = kNeoBlobFileLength + 600;
  76.  
  77. const long kNDImageLength        = sizeof(CNDImage);
  78.  
  79. #define pImageExposure    'IMex'
  80. #define pImageFilm        'IMfl'
  81. #define pImageFocal        'IMfc'
  82. #define pImageFStop        'IMfs'
  83. #define pImageCamera    'IMcm'
  84. #define pImageKeyCount    'IMkc'
  85. #define pImageKeys        'IMky'
  86. #define pImageBy        'IMby'
  87. #define pImageDate        'IMdt'
  88. #define pImageCatalog    'IMcg'
  89.  
  90. class CNeoKeywordSelect : public CNeoTypeSelect {
  91. public:
  92.                         /** Instance Methods **/
  93.                         CNeoKeywordSelect(const char *aKeyword);
  94.  
  95.     NeoOrder            compare(CNeoPersist *aObject, const short aIndex, NeoOrder *aKeyOrder) const;
  96.  
  97.                         /** Accessing Methods **/
  98.     void                getKeyword(char *aKeyword) const;
  99.     void                setKeyword(const char *aKeyword);
  100.  
  101.                         /** Instance Variables **/
  102. protected:
  103.     char                fValue[33];
  104. };
  105.